Send push notifications to Mac, iOS, iPadOS, tvOS devices through your app using the Apple Push Notifications service (APNs).

APNS Documentation

Pinned Posts

Posts under APNS tag

255 Posts
Sort by:
Post not yet marked as solved
0 Replies
60 Views
Hi everybody, I'm trying to implement Firebase messaging into a new iOS app. I've done everything (add Background Mode and Push Notification capabilities, import my key into FIrebass, ...) as describe in different tutorials that I founded on internet. The fact is that the console doesn't show me a token.. Does someone has an idea ? Here's my code : // pushnotifApp.swift // pushnotif // // Created by Thibault COLLIN on 13/05/2024. // import SwiftUI import FirebaseCore import FirebaseMessaging import UserNotifications class AppDelegate: NSObject, UIApplicationDelegate, MessagingDelegate, UNUserNotificationCenterDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { print("Application did finish launching") FirebaseApp.configure() Messaging.messaging().delegate = self UNUserNotificationCenter.current().delegate = self let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound] UNUserNotificationCenter.current().requestAuthorization(options: authOptions) { (granted, error) in if granted { print("Notification authorization granted") DispatchQueue.main.async { application.registerForRemoteNotifications() } } else { print("Notification authorization denied") } } return true } func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) { print("Firebase registration token received: \(String(describing: fcmToken))") } } @main struct pushnotifApp: App { @UIApplicationDelegateAdaptor(AppDelegate.self) var delegate var body: some Scene { WindowGroup { ContentView() } } } And the console result : Application did finish launching 10.26.0 - [FirebaseMessaging][I-FCM001000] FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers. If you'd prefer to manually integrate Firebase Messaging, add "FirebaseAppDelegateProxyEnabled" to your Info.plist, and set it to NO. Follow the instructions at: https://firebase.google.com/docs/cloud-messaging/ios/client#method_swizzling_in_firebase_messaging to ensure proper integration. Notification authorization granted
Posted
by JasperApp.
Last updated
.
Post not yet marked as solved
0 Replies
49 Views
Hey everyone, I've noticed a recent issue in my app where users are not receiving automatic updates/ blank push to the pass added to the user wallet. Instead, they have to manually refresh the pass by dragging down the back of the Apple Wallet to see any updates. This might be because the blank push notification is not updating the passes. If you've encountered this problem or have any insights into what might be causing it, I'd love to hear from you. Your feedback is invaluable to me.
Posted
by ANJU_1210.
Last updated
.
Post not yet marked as solved
0 Replies
99 Views
大发彩票app下载【筷三凝聚梦想】【永盈成就辉煌】【购彩首选】【全网第一】 【誉响彩界】【 问鼎巅峰】 没有那么多天赋异禀,优秀的人总是努力的翻山越岭,要么不做,要做就做第一!没有做不到的事只有你愿不愿意做,做的人已经上岸了,若你还是不敢做只能看著他们上岸,已经有个理想的计划,但从未有赴之行动的举动,那你永远都只能是想像,你想成为上岸的那个人,还是想成为看人上岸的那个人,这些都决定于你。专业的事留给专业的人做,才是获得成功的捷径。我想帮助更多的人,互联网是一个开放性平台,上面充斥着各式各样的优惠,如何在铺面而来的诱惑中选出心仪的方向。 一个好的平台可以让你后顾无忧,可以尽情释放自己的手脚,不会存在掣肘。穷则思变,差则思勤!没有比人更高的山没有比脚更长的路。 原以为“得不到”和“已失去”是最珍贵的,可…原来把握眼前才是最重要的。 失败是什么?没有什么,只是更走近成功一步;成功是什么?就是走过了所有通向失败的路,只剩下一条路,那就是成功的路
Posted
by mama01.
Last updated
.
Post not yet marked as solved
1 Replies
104 Views
Criticism of the use of the Minimed Mobile App, problem with the update interval of the Apple Watch iOS Subject: Error event - Minimed Mobile App . Triggered by insufficient update interval of the Watch iOS system of only 50 updates/day Dear Sir or Madam, I use the Minimed Mobile App in conjunction with my Medtronic 780 G insulin pump and am generally very satisfied with the app. However, I have noticed a point here that is caused by the Apple Watch iOS operating system. I would like to pass this on and ask that you please fix this problem with an update. Updating the sensor values on watch faces on the Apple Watch I use the Modular widget on my Apple Watch in conjunction with the Minimed mobile app to quickly and easily keep an eye on the current sensor value. Unfortunately, the sensor value in this widget is not updated automatically according to someone in the know, Apple only updates widget information 50 times a day. After a short time, a rotating arrow appears instead of the current value, which I have to press to get a sensor value displayed again in order to see the current value. This is very inconvenient as I have to perform several actions each time to see the current value: 1.Open widget 2.Press the rotary arrow 3.Read the value Close widget by pressing the spin button at the top right to return to the main screen I would very much welcome it if the sensor value in Apple Watch watch faces were updated automatically, the problem is obvious - the watch faces only update 50 times a day. This would prevent me from seeing the current sensor value quickly and easily at any time without having to perform additional and cumbersome actions. The Minimed Mobile App has been tested and approved by Medtronic through Apple. However, it must have been overlooked that this sensor value app updates the sensor value every 5 minutes, but it does not do this on the dial because, according to my friend, it only updates 50 times a day. Now it is the case that the sensor value can change every 5 minutes, but this is not shown on the watch face, which means that the Apple Watch iOS would need 288 updates for this Minimed Mobile App per day instead of only 50 updates per day. Can you please advocate for a new update that allows an update interval of up to 288 updates per day? So that thousands of diabetics worldwide can see current values on their Apple Watch dials at any time? Without having to take several steps each time? I switched to I Phone and Apple Watch because I thought this would be possible for me. I would be very happy to hear back if this is technically possible for all diabetics worldwide who will benefit from it. With kind regards
Posted Last updated
.
Post not yet marked as solved
0 Replies
95 Views
I'm sending a push notification using Noticed Gem during the night when my phone is in airplane mode. When I wake up and disable the airplane mode, I don't get the push notification. These are the settings: ` def ios_format(apn) apn.custom_payload = { universal_link: url } apn.alert = { title: title(recipient), body: message(recipient) } apn.sound = 'default' apn.priority = '10' # Send immediately, bypassing the end ` default expiration is supposed to be 30 days. How can I debug/fix the problem? (with noticed gem) I checked Apple consoleKIT, and I don't see discarded notifications. Thanks
Posted Last updated
.
Post not yet marked as solved
0 Replies
90 Views
Hello, We have an iOS application (navigation/mobility app) that we need to have it stay connected to TCP server even app is in background. We tried disabling screen lock. We tried having location permission as "always". But it is not consistent. Usually, after 15 minutes, TCP connection is disconnected. We are unable to run code on app's side if it is in the background. Our other workaround option is similar to WhatsApp or what every other companies / our rivals in the market do. Have a VOIP feature, use voip notification to wake up the app. But we really don't want to do that sort of thing. Any feedback and any ideas are welcomed. Thanks.
Posted Last updated
.
Post not yet marked as solved
0 Replies
82 Views
Hey A lot of our customers got duplicate push messages twice or more times But we sent only once per push tokens Additionally, devices experiencing the same happens receive similar push messages twice or more from other companies' application This happens is especially reported on devices that have upgraded from iOS 16 to 17. Is there something wrong with the APNS? It
Posted
by Ohjune.
Last updated
.
Post not yet marked as solved
0 Replies
90 Views
Steps to reproduce: Install & Launch App When push notifications are registered, the push notification token received is a "production" push notification token rather than a "development" push notification token. We are trying to test on the sandbox environment with development push notification tokens, however the apn-environment for all builds we release via TestFlight are being set to "production". We wish to distribute builds via TestFlight with apn-environment set to "development". At the moment we have only found one way to run the app with apn-environment set to "development" which is to "Export" a Debug build, then manually install it on a device via iTunes on Windows machines. This method is not efficient or considered seamless enough for non-technical testers and stakeholders. They require a seamless way to receive Debug builds via TestFlight without resorting to other third-party platforms which allow us to manually upload the "Exported Debug build". If anyone knows how to upload a "Debug" build to Testflight which will allow the user to receive a sandbox development push token with "apn-environment" set to development I would really appreciate it.
Posted
by draskov87.
Last updated
.
Post not yet marked as solved
2 Replies
329 Views
We are interested to know what is the rate limit on the push notifications for live activities. We understand there is a "budget" on the amount of push notifications on a users device. But is there some rate limitation we should be aware of on APNs?
Posted Last updated
.
Post not yet marked as solved
1 Replies
126 Views
概述 应用的数据中心在海外 群名称:”CDC 大家樂集團 體驗群“ 群成员A、群成员B、群成员C 问题描述: ”CDC 大家樂集團 體驗群“聊天群里的成员A给成员C发群消息,C可以收到推送消息; 成员B给C发消息,C收不到推送消息;C不是一直都收不到B的消息,而是频繁出现收不到的情况。 B给C发送消息时,服务端调用APNs服务报异常:Notification rejected by the APNs gateway。 麻烦帮查一下是什么原因导致的服务端调用APNs服务报异常。
Posted
by YonZone.
Last updated
.
Post marked as solved
1 Replies
189 Views
Greetings everyone, we have a problem testing remote notifications to our app runing in an iOS simulator, which should be possible for quite a while now. (https://nilcoalescing.com/blog/TestingRemotePushOniOSSimulator/) We made sure of the following prerequisites The system requirements (recent XCode, recent MacOS, Silicone Processor) are met The app build is set to testing The app is in fact generating a devicetoken and sendig it to our backend We are sending our requests to the api.sandbox.push.app.com environment Nonetheless, we always receive a status 400, error "BadDeviceToken" response from the APNS service. Doing the same with a physical device works like a charm, ie the message is received without any problems. We also tried sending the same device token to a production environment, but got the same 400/BadDeviceToken error. Also the simulator-generated token does not look distorted, ie it's also just a HEX string with the same length as the working token of the physical device. Is there anything else we need to check for this to work?
Posted Last updated
.
Post not yet marked as solved
9 Replies
1.5k Views
Hello everyone, I have been working on a macOS app that utilizes push notifications for the past year. Up until recently, everything was functioning correctly. However, now I'm experiencing issues where push notifications are either not being delivered at all or are experiencing significant delays, sometimes up to 10 minutes. Setting the priority header to 10 hasn't made any difference. I am currently using development push notifications, but the issue persists when switching to the production environment. I'm curious if anyone else has encountered similar problems. When checking the push console, it frequently reports that the device is offline, even though it's actually online ("discarded as device was offline"). Occasionally, notifications are delivered promptly, but this is becoming increasingly infrequent. This issue has been consistently reported by our testers, particularly after they updated to macOS Sonoma. Any insights or assistance you can provide would be greatly appreciated.
Posted
by XVC_.
Last updated
.
Post not yet marked as solved
0 Replies
195 Views
I am trying to start a live activity using APNs, but it is not supported with firebase or onesignal, is there any other way to send a PN to the device, I have device token, bundle ID, team ID, and apnsKeyID. I also tried hitting this URL: 'https://api.development.push.apple.com/3/device/{deviceToken}', but it gives an error "unable to set private key file" even though I have given the path to my .pem file that has a private key in it enclosed under BEGIN CERTIFICATE and END CERTIFICATE. It will be great if someone could guide me here
Posted
by gsuzair.
Last updated
.
Post not yet marked as solved
0 Replies
159 Views
I use the following push notification payload. { "aps": { "sound": { "name": "default", "volume": 0 } }, "type": "refresh" } When the iPhone received this, it sounds even though "volume" is set to "0". Is this iOS bug? Or dose "default alert sound" of iOS17 override this? I tested iOS17 and 16. This occurred both. Is there any way to set no sound when iPhone received a specific push notification like "type": "refresh".
Posted Last updated
.
Post not yet marked as solved
0 Replies
169 Views
Hi, I’m testing out different possibilities for a client that wants to have a loyalty card service where users can register to download and install a wallet pass. This wallet pass should be able to receive push notifications. I have found a library that can generate apple passes but I struggle to find a good direction with the notification / update service. I’m most comfortable with using PHP but any other easy solution is also welcome. What would be a good way to start and test things out? Thank you!
Posted
by lkssmnt.
Last updated
.
Post not yet marked as solved
0 Replies
155 Views
Hello fellow developers, I am creating an application and it contains critical alerts and for that I have given the permissions but unable to find any implementations. I am using Flutter environment to develop my application and want that the application should emit a sound even if it is silent or in 'Do Not Disturb' mode.
Posted
by 0101Adil.
Last updated
.
Post not yet marked as solved
0 Replies
193 Views
I think I've got all the keys and entitlements set up ok. I have no problem receiving normal alerts via the UNUserNotifications framework. Now I'm trying to use PushKit (for fileProvider). I have the following in my AppDelegate fileProvider = PKPushRegistry(queue: nil) fileProvider.delegate = self fileProvider.desiredPushTypes = [.fileProvider] along with the required delegate functions. I am never provided with credentials, only an immediate call to the didInvalidatePushToken delegate. Any suggestions appreciated.
Posted Last updated
.
Post not yet marked as solved
1 Replies
263 Views
Hello Apple Developer Community, I am reaching out for insights regarding an issue we're facing with Apple Push Notification Service (APNS). Despite successful implementation and functioning for other apps, we are consistently receiving a 400 TopicDisallowed error when trying to send push notifications to one specific app. Here's a detailed overview: Issue Summary: Push notifications sent from our server to a specific app result in a 400 TopicDisallowed error from APNS. This problem is unique to this app; notifications to other apps with similar configurations are successful. Successful Tests via Apple CloudKit Console: Notably, when using the Apple CloudKit Push Notification Console, push notifications to the problematic app are sent successfully, indicating the app's basic setup is configured correctly. Key Details: The topic field in the push notification request matches the app's bundle ID exactly. The app is downloaded from the App Store, and we are using the production environment on our server. Payload structure, APNS endpoint, and APNS Auth Key are consistent across all apps we manage. Device tokens for the problematic app validate successfully using the tool in the push notification console. Detailed server-side logging has not revealed significant differences between successful and unsuccessful push notification requests. Given these factors, we are struggling to identify the root cause of this specific issue. I am wondering if anyone in the community has faced a similar problem or could offer any insights. Any help or guidance would be immensely appreciated. Thank you in advance!
Posted
by appful.
Last updated
.